/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.sisdoctor.persistencia.util;

import java.util.List;

import br.com.sisdoctor.persistencia.exceptions.JPADeleteException;
import br.com.sisdoctor.persistencia.exceptions.JPAInsertException;
import br.com.sisdoctor.persistencia.exceptions.JPAQueryException;
import br.com.sisdoctor.persistencia.exceptions.JPAUpdateException;
import br.com.sisdoctor.persistencia.exceptions.JPAUtilityException;

/**
 * 
 * @author andremarllus
 */
public interface GenericDao<T> {

	T save(T entidadeGenerica) throws JPAInsertException;

	void delete(Object campo) throws JPADeleteException;

	Object update(Object entidadeGenerica) throws JPAUpdateException;

	T getObjectChave(Class<? extends T> clazz, int chave)
			throws JPAQueryException;

	List<T> listObjects(String consulta) throws JPAQueryException;

	List executeNamedQuery(String nome, Object... args)
			throws JPAQueryException, JPAUtilityException;

	List executeNativeQuery(String sql, Object[] args) throws JPAUtilityException;

	Object getFirstByNativeQuery(String nome, Object[] args) throws JPAUtilityException;

	Object getFirstByNamedQuery(String nome, Object[] args) throws JPAUtilityException;
	
	Object getFirstByNamedQueryObject(String nome, Object... args) throws JPAUtilityException;

}
